package icursoft.educationms;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;

import icursoft.educationms.ui.user.LoginActivity;


public class MainActivity extends Activity implements Runnable {
    Context mContext;
    Handler handler = null;
    int SPLASH_DISPLAY_SECONDS = 1500;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_main);
        setupViews();
        initialized();

    }
    protected void setupViews() {
        mContext = this;
    }

    protected void initialized() {

        handler = new Handler();
        handler.postDelayed(this, SPLASH_DISPLAY_SECONDS);

    }
    @Override
    public void run() {
//        if (PreferencesService.getInstance(mContext).getIsLogin()) {
//            String uid = PreferencesService.getInstance(mContext).getUserId();
//            String tokenLong = PreferencesService.getInstance(mContext).getTokenLong();
//            MachTalkUtil.getTokenShort(getTokenCallback, uid, tokenLong);
//        } else {
//            Intent intent = new Intent(MainActivity.this, LoginActivity.class);
//            startActivity(intent);
//            finish();
//        }
        Intent intent = new Intent(MainActivity.this, LoginActivity.class);
            startActivity(intent);
            finish();
    }
}
